/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.scene.mapper;

import com.koron.scene.domain.HealthCheck;
import org.apache.ibatis.annotations.Param;
import org.koron.ebs.mybatis.EnvSource;

import java.util.Date;
import java.util.List;

@EnvSource("_default")
public interface HealthCheckMapper {

    /**
     * insert health
     * @param health
     * @return
     */
    Integer insert(@Param("health") HealthCheck health);

    /**
     * delete health in batch
     * @param idList
     * @return
     */
    Integer batchDetele(@Param("idList") List<String> idList);


    /**
     * update one health
     * @param health
     * @return
     */
    Integer update(@Param("health") HealthCheck health);

    /**
     * query the one whose id is the given
     * @param id
     * @return
     */
    HealthCheck queryOne(@Param("id") String id);


    /**
     * fetch all health check in the given condition
     * @param staffName
     * @param deptName
     * @param beginTime
     * @param endTime
     * @param start
     * @param rows
     * @return
     */
    List<HealthCheck> queryByCondition(@Param("corpCode") String corpCode, @Param("staffName") String staffName, @Param("deptName") String deptName,
                                       @Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("start") Integer start, @Param("rows") Integer rows);

    /**
     * the number of health check complying with the condition
     * @param staffName
     * @param deptName
     * @param beginTime
     * @param endTime
     * @return
     */
    Integer countByCondition(@Param("corpCode") String corpCode, @Param("staffName") String staffName, @Param("deptName") String deptName,
                             @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);


}
